/*  KKS - KinoKassenSystem 2013
 * 
 *  author Sebastian Schöppner
 * 
 *  Database Connection Class 
 * 
 *  
 */
package kks;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DBConnection 
{
    /**
    * establish a connection to the database
    * <p>
    *
    * @return Connection 
    * 
    */
    public static Connection getConnection() 
    {
    	try	
        {
            //driver implement
            Class.forName("org.hsqldb.jdbcDriver");

            //create connection object			
            String conString ="jdbc:hsqldb:file:C:\\workspace\\kks\\src\\kks\\db;shutdown=true"; //c:/Daten/db/
            Connection con = DriverManager.getConnection(conString,"sa","");
            return con;		    	
        }
	catch (ClassNotFoundException e) 
        {
            System.out.println("driver not found");
            return null;
		
        }
        catch (SQLException e) 
        {
                System.out.println("there was an error!");
                System.out.println(e.getMessage());
                return null;
        }    	
    }    
}
